package com.fireBird.ai.flower.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.fireBird.ai.flower.entity.Flower;
import com.fireBird.ai.flower.service.FlowerService;

@RestController
public class FlowerController {
    @Autowired
    FlowerService service;

    @RequestMapping("/getFlowerById/{id}")
    public Flower getFlowerById(@PathVariable("id") Integer id){

        return service.getFlowerById(id);
    }

    @RequestMapping("/getFlowerByCode/{code}")
    public Flower getFlowerByCode(@PathVariable("code") String code){

        return service.getFlowerByCode(code);
    }
}